<?php
class tbl_admin_member extends AppModel
{
    public $useTable = 'tbl_admin_member';
    public $useDbConfig = 'tales_of_deonia';
    public $primaryKey = 'admin_num';

    public function admin_login($_id, $_pass)
    {
        $params = array(
            'conditions' => array(
                'admin_id' => $_id
            ),
            'fields' => array(
                'admin_num', 'admin_id', 'admin_pass', 'admin_name'
            ),
        );

        $data = $this->find('first', $params);

        if(!empty($data))
        {
            if($_pass != decryptMd5Base64($data['tbl_admin_member']['admin_pass']))
            {
                return false;
            }
        }

        return $data;
    }

}